/**
 * 
 */
package com.ofek.eventos.net.lks;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author Ofek
 *
 */
public class ItemVersion<IDT,IT> implements Serializable {
	public IDT id;
	public IT item;
	public long version;
	public ItemVersion(final IDT id, final IT item,final long version) {
		this.id = id;
		this.item = item;
		this.version = version;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "["+id+","+item+","+version+"]";
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return Objects.hash(id,version);
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(final Object obj) {
		return super.equals(obj) || ((obj instanceof ItemVersion) && id.equals(((ItemVersion)obj).id) && version==((ItemVersion)obj).version);
	}
}
